//
//  MYHttpTool.h
//  奇闻
//
//  Created by 似水灵修 on 14-11-26.
//  Copyright (c) 2014年 MingYueGuCheng. All rights reserved.
//  网络请求POST和GET

#import <Foundation/Foundation.h>
#import "MYUploadParam.h"

@interface MYHttpTool : NSObject
/**
 *  POST请求
 *
 *  @param URLString  请求地址
 *  @param parameters 请求参数
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)POST:(NSString *)URLString
                      parameters:(id)parameters
                         success:(void (^)(id responseObject))success
                         failure:(void (^)(NSError *error))failure;
/**
 *  GET请求
 *
 *  @param URLString  请求地址
 *  @param parameters 请求参数
 *  @param success    成功回调
 *  @param failure    失败回调
 */
+ (void)GET:(NSString *)URLString
                      parameters:(id)parameters
                         success:(void (^)(id responseObject))success
                         failure:(void (^)(NSError *error))failure;
/**
 *  上传
 *
 *  @param URLString   请求地址
 *  @param parameters  请求参数
 *  @param uploadParam 上传参数
 *  @param success     成功回调
 *  @param failure     失败回调
 */
+ (void)upload:(NSString *)URLString
                         parameters:(id)parameters
                        uploadParam:(MYUploadParam *)uploadParam
                            success:(void (^)(id responseObject))success
                            failure:(void (^)(NSError *error))failure;
/**
 *  监控当前网络状态
 *
 *  @param app 该参数默认是:[UIApplication sharedApplication]，填nil
 */
+ (void)monitorHttpStateChangedResult:(void (^)(NSString *result))result;
@end
